package homelesspartners.server.utils;

import java.io.IOException;
import java.sql.SQLException;

import javax.naming.NamingException;

public class Main {

	public static final int SORT_ORDER_UPDATER = 0;
	public static final int THANK_YOU_SENDER = 1;

	/**
	 * @param args
	 * @throws SQLException
	 * @throws NamingException
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException, NamingException, SQLException {

		int processToRun = Integer.parseInt(args[0]);
		switch (processToRun) {
			case SORT_ORDER_UPDATER:
				if(args.length > 1) {
					SortOrderUpdater.main(new String[] { args[1] });	
				} else {
					SortOrderUpdater.main(new String[0]);
				}
				
				break;

			case THANK_YOU_SENDER:
				if(args.length > 1) {
					ThankYouSender.main(new String[] { args[1] });	
				} else {
					ThankYouSender.main(new String[0]);
				}
				
				break;

			default:
				System.out.println("no matching process found");
				break;
		}

	}

}
